package com.rc.evcharger.common.redis;

import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;

public interface RedisDao {

    void putSession(String key, Object value);

    Object getSession(String key);

    void putListSession(String key, Object value);

    List getListSession(String key);

    void popListSession(String key);

    void setListSession(final String key, final int index, final Object value);

    Long listSessionSize(final String key);

    void removeListSession(final String key, final long index, final Object value);

    void putHashSession(final String key, final String keyMap, final Object obj);

    void putHashAllSession(final String key, final Map map);

    void delHashKeyMap(final String key, final String keyMap);

    Map getHashAllSession(final String key);

    Object getHashSession(final String key, final String mapKey);

    void deleteSession(final String key);

    Object keys(final String key);

    void leftPushList(String key, Object value);

    void rightPushList(String key, Object value);

    Object rightPopList(String key);

    void rightPopAndLeftPush(String key1, String key2);

    void putRedis(String key, String value);

    String getRedis(String key);

    void addExpire(String key, Integer time, TimeUnit timeUnit);

    void addExpireValue(String key, Object value, Integer time, TimeUnit timeUnit);

    Object getOpsForRedis(String key);

    //保证原子性操作，用作事务判断
    boolean setIfAbsent(String key, Object value,long time);

}
